package com.hanlan.springboot.service.impl;

import com.hanlan.springboot.entity.Student;
import com.hanlan.springboot.mapper.StudentMapper;
import com.hanlan.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description: Service的接口实现类
 * @author: 01369542
 * @create: 2018/11/15
 **/
@Service("studentService")
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> getAllStudents() {
        return studentMapper.selectAll();
    }

    @Override
    public Student addStudent(Student student) {
        return studentMapper.insert(student);
    }

    @Override
    public Student selectByPrimaryKey(Integer id) {
        return studentMapper.selectByPrimaryKey(id);
    }
}
